#include<bits/stdc++.h>

using namespace std;

int main() {
    vector<int> v = {1, 0, 0, 0};
    //1*1+2*2+3*3+4*4; vv
    cout << inner_product(v.begin(), v.end(), v.begin(), 0) << endl;

//    v[0] = v[0];
//    for (int i = 1; i < v.size(); i++) {
//        v[i] = v[i - 1] + v[i];
//    }
    for (int i = 0; i < 10; i++) {
        partial_sum(v.begin(), v.end(), v.begin());
        for_each(v.begin(), v.end(), [](int x) -> void {
            cout << x << " ";
        });
        cout << endl;
    }


}